<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@include file="/common/taglibs.jsp"%>
<html>
<head>
<title>通知公告管理</title>
<%@include file="/common/ec.jsp"%>
<%@include file="/common/extjs.jsp"%>
<%@include file="/common/meta.jsp"%>
</head>
<body>
<div class="x-panel">
<div class="x-panel-header">通知公告管理</div>
<div class="x-toolbar">
<table width="99%">
  <tr>
    <s:form action="index.do" method="post">
	    <td >标题：
	    <s:textfield name="model.title" size="30"/>
		起始时间： 
		<input type="text" name="startTime" style="width: 100px"
			value='<s:date name="startTime" format="yyyy-MM-dd"/>'
			onfocus="WdatePicker({maxDate:'#F{$dp.$D(\'endTime\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
			class="Wdate" />
                     截至时间：
		<input type="text" name="endTime" style="width: 100px"
			value='<s:date name="endTime" format="yyyy-MM-dd"/>'
			onfocus="WdatePicker({minDate:'#F{$dp.$D(\'startTime\')}',skin:'whyGreen',dateFmt:'yyyy-MM-dd'})"
			class="Wdate" />
	    <input type="submit" value="查询" class="button" /></td>
	    <td style=" padding-left:5px; padding-top:5px;" align="right">   
	        <a href="${ctx}/notice/edit.do"><img src="${ctx}/images/icons/add.gif">添加通知公告</a>
	    </td>
    </s:form>
  </tr>
</table>
</div>
<div class="x-panel-body">
<ec:table
	items="items" 
	var="item" 
	retrieveRowsCallback="process"
	sortRowsCallback="process" 
	action="index.do" 
	useAjax="false"
	doPreload="false" 
	pageSizeList="20,50,100,200" 
	editable="false"
	sortable="false" 
	rowsDisplayed="20" 
	generateScript="true"
	resizeColWidth="false" 
	classic="false" 
	width="100%" 
	height="460px"
	minHeight="460"
	toolbarContent="navigation|pagejump|pagesize|refresh|extend|status">
	<ec:row>
	    <ec:column width="40" property="_s" title="No." value="${GLOBALROWCOUNT}" sortable="false" style="text-align:center"/>
		<ec:column width="290" property="title" title="标题" ellipsis="true">
		<a href="${ctx}/notice/view.do?model.id=${item.id}" title="查看通知公告" target="_blank"><font color="blue">${item.title}</font></a>
		</ec:column>	
		<ec:column width="100" property="publisher.name" title="发布人" style="text-align:center"/>
		
		<ec:column width="140" property="createTime" title="发布时间" style="text-align:center" format="yyyy-MM-dd HH:mm:ss" cell="date"/>
		<ec:column width="100" property="_0" title="操作" style="text-align:center" sortable="false">
		<a href="${ctx}/notice/edit.do?model.id=${item.id}" title="修改通知公告">编辑</a> | 
		<a href="#" onclick="remove(${item.id})" title="删除通知公告">删除</a>  	
		</ec:column>
	</ec:row>
</ec:table>
</div>
</div>
<script type="text/javascript">
  function remove(id) {
    Ext.MessageBox.confirm('提示','确认要删除所选择的通知公告吗？删除后不能恢复！', function(btn){
        if (btn == 'yes') {
          window.location = "${ctx}/notice/remove.do?model.id=" + id;
        }
    });
  }
</script>
</body>
</html>